package com.admin.service;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.admin.dao.AdminOrderDao;
import com.bean.AdminOrder;
import com.user.dao.OrderDetailDao;
@Service("AdminOrderService")
public class AdminOrderServiceImp implements AdminOrderService{
    @Autowired
    private AdminOrderDao adminOrderDao;
    @Autowired
    private OrderDetailDao orderDetailDao;
	public String deletepetOrder(AdminOrder petOrder, HttpServletRequest req) {
		// TODO Auto-generated method stub
		int re=adminOrderDao.deleteOrder(petOrder);
		if(re<0) {
			return "admin/error";
		}else {
			return "admin/suc";
		}
	}
	public String updatepetOrder() {
		// TODO Auto-generated method stub
		int re=adminOrderDao.update();
		if(re<0) {
			return "admin/error";
		}else {
			orderDetailDao.updateOrderDetail();
			return "admin/suc";
		}
	}
	public String selectpetOrder(HttpServletRequest req) {
		// TODO Auto-generated method stub
		List<AdminOrder>listorder=adminOrderDao.selectOrder();
		req.setAttribute("list", listorder);
		return "admin/showorder";
	}
	public String selectLishiOrder(HttpServletRequest req) {
		// TODO Auto-generated method stub
		List<AdminOrder>listorder=adminOrderDao.selectLishiOrder();
		req.setAttribute("list", listorder);
		return "admin/showlishiorder";
	}
	
}
